<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <title>斑马线交规驾考系统</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/main_test.css">
</head>
<body>
<div id="containerDiv">
    <div class="success-text">本次测试成绩:<span></span></div>
    <div class="exam-result">
        <ul>
            <li>考试车型：<span></span></li>
            <li>考试科目：<span></span></li>
            <li>答题数量：<span></span></li>
            <li>答对数量：<span></span></li>
            <li>答错数量：<span></span></li>
            <li>未答数量：<span></span></li>
        </ul>
    </div>
    <div class="home-btndiv"><button id="LayerErrorid" class="home-btn1 pointer">错题重做</button> <button class="home-btn1 pointer" id="layerBtnExitExam">退出测试</button></div>
</div>
</body>
</html>
<script src="${pageContext.request.contextPath}/static/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/static/layer/layer.js"></script>
<script src="${pageContext.request.contextPath}/static/js/importants.js"></script>
<script>
    $(function () {
        var chengji  = $("#PractRe li:eq(4) span",window.parent.document).html()*1.0*100;
        $(".success-text span").html(chengji+" 分");
        if( chengji>=0.9){
            $("#containerDiv").addClass("container2");
        }else{
            $("#containerDiv").addClass("container1");
        }
        //显示统计成绩
        $("div.exam1-2 ul>li").find("span");
        $(".exam-result li:eq(0) span").html($("div.exam1-2 li span",window.parent.document).eq(4).html());
        $(".exam-result li:eq(1) span").html($("div.exam1-2 li span",window.parent.document).eq(3).html());
        $(".exam-result li:eq(2) span").html($("#PractRe li:eq(0) span",window.parent.document).html());
        $(".exam-result li:eq(3) span").html($("#PractRe li:eq(1) span",window.parent.document).html());
        $(".exam-result li:eq(4) span").html($("#PractRe li:eq(2) span",window.parent.document).html());
        $(".exam-result li:eq(5) span").html($("#PractRe li:eq(3) span",window.parent.document).html());


        $("#LayerErrorid").click(function () {
            $('#ErrorId', window.parent.document).trigger("click");
            var index=window.parent.layer.getFrameIndex(window.name);
            window.parent.layer.close(index);
        });

        $("#layerBtnExitExam").click(function () {
            /*  var index=window.parent.layer.getFrameIndex(window.name);
              window.parent.layer.close(index);*/

            $.ajax({
                type: 'GET',
                dataType: "json",
                async: false,
                url: '/temprorary/test/exit',
                success: function (msg) {
                    if (msg) {
                        if(msg["status"]){
                            window.parent.location.href="/p/user/zuser-index";
                        }
                    }
                }
            });
        });
    });
</script>
